package br.ufrj.neg.util;


import java.io.StringWriter;
import java.util.List;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;

import br.ufrj.neg.bean.Idioma;
import br.ufrj.neg.evento.bean.EventoBean;
import br.ufrj.neg.evento.bean.LogomarcaBean;
import br.ufrj.neg.preparacao.bean.NegociacaoBean;
import br.ufrj.neg.servlet.PageContext;
import br.ufrj.neg.usuario.bean.UsuarioBean;

public class AccessSystemResource {

	public String getRelatorioReuniao(EventoBean evento,NegociacaoBean negociacao,Idioma idioma,PageContext pc,UsuarioBean ub,List<LogomarcaBean> logos,Template template){
		
		Velocity.init();
		
		VelocityContext context = new VelocityContext();			
		context.put("pageContext",pc);
		
		if(ub!=null){
			context.put("negociacaoBean",negociacao);
			context.put("eventoBean",evento);
			context.put("logos", logos);
		}
		
		StringWriter sw = new StringWriter();
		template.merge(context, sw);
		
		return sw.toString();				
	}	
		
}
